<?php

namespace Houdunren\WeChat\Message;
trait MessageType
{
    public function isText()
    {
        return $this->message->MsgType == 'text';
    }

    public function isImage()
    {
        return $this->message->MsgType == 'image';
    }

    public function isVoice()
    {
        return $this->message->MsgType == 'voice';
    }

    public function isVideo()
    {
        return $this->message->MsgType == 'video';
    }

    public function isShortvideo()
    {
        return $this->message->MsgType == 'shortvideo';
    }

    public function isLocation()
    {
        return $this->message->MsgType == 'location';
    }

    public function isLink()
    {
        return $this->message->MsgType == 'link';
    }

    //事件消息
    public function isSubscribe()
    {
        return $this->message->MsgType == 'event' && $this->message->Event == 'subscribe';
    }


}
